<?php
require_once '../controller.php';
$c = new Course($params->c);
$groups = $c->getAllGroups();
?>
<div class='course-info'>
<div class='course-data'>
	<p>Term: <?php print $c->term; ?></p>
	<p>Description: <?php print $c->description; ?></p>
</div>
<h3>Groups:</h3>
<?php
if($groups != null) {
	foreach($groups as $g) {
?>
<div id='group-<?php print $g->id; ?>' class='group'>
	<a href='javascript: expandGroup("group-<?php print $g->id; ?>")' class='expand'><?php print $g->name; ?></a>
	<div class='group-options'>
		<a href='javascript: popup("modifygroup.php?g=<?php print $g->id; ?>")'>modify</a> |
		<a href='javascript: popup("deletegroup.php?g=<?php print $g->id; ?>")'>delete</a> |
		<a id='update-<?php print $g->id; ?>' href='javascript: updateGroupFeeds("<?php print $g->id; ?>")'>update</a>
	</div>
</div>
<?php
	}
} else {
?>
<div class='group'>
	<p>Looks like you haven't added any groups for monitoring, yet.</p>
</div>
<?php
}
print button('add_group','Add Group',array('type'=>'button','onclick'=>"popup('addgroup.php?c=$c->id');",'class'=>'group'));
?>
</div>